//
//  GFGlTableViewCell.m
//  Qyer
//
//  Created by dlios on 15/10/22.
//  Copyright (c) 2015年 GF. All rights reserved.
//

#import "GFGlTableViewCell.h"

@implementation GFGlTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _image = [[UIImageView alloc] initWithFrame:CGRectMake(5 * WIDTH, 5 * HEIGHT, SCREEN_WIDTH - 10 * WIDTH, 150 * HEIGHT)];
        [self.contentView addSubview:_image];
        
        _name_zh_cnLable = [[UILabel alloc] initWithFrame:CGRectMake(5 * WIDTH, 5 * HEIGHT, SCREEN_WIDTH - 20 * WIDTH, 20 * HEIGHT)];
        [_name_zh_cnLable setFont:[UIFont systemFontOfSize:WIDTH * 14.]];
        [_name_zh_cnLable setTextColor:[NightMode shareNightModeHandle].wordColor];
        [_image addSubview:_name_zh_cnLable];
        _name_enLable = [[UILabel alloc]initWithFrame:CGRectMake(5 * WIDTH, 25 * HEIGHT, SCREEN_WIDTH - 20 * WIDTH, 20 * HEIGHT)];
        [_name_enLable setFont:[UIFont systemFontOfSize:WIDTH * 14.]];
        [_name_enLable setTextColor:[NightMode shareNightModeHandle].wordColor];
        [_image addSubview:_name_enLable];
        NSArray *imgArr = @[@"lc.png" ,@"lxd.png", @"zt.png"];
        NSArray *laArr = @[@"旅程", @"旅行地", @"专题"];
        for (int i = 0; i < 3; i++) {
            UIImageView *buttonImg = [[UIImageView alloc] initWithFrame:CGRectMake(64 * WIDTH + 104 * WIDTH * i, 155 * HEIGHT, 40 * WIDTH, 40 * HEIGHT)];
            [buttonImg setImage:[UIImage imageNamed:[imgArr objectAtIndex:i]]];
            [self.contentView addSubview:buttonImg];
            
            UILabel *lable = [[UILabel alloc] initWithFrame:CGRectMake(64 * WIDTH + 104 * WIDTH * i, 195 * HEIGHT, 40 * WIDTH, 20 * HEIGHT)];
            [lable setFont:[UIFont systemFontOfSize:WIDTH * 13.]];
            [lable setTextColor:[NightMode shareNightModeHandle].wordColor];
            [lable setText:[laArr objectAtIndex:i]];
            [lable setTextAlignment:NSTextAlignmentCenter];
            [self.contentView addSubview:lable];
            
            }
        _lcButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_lcButton setFrame:CGRectMake(64 * WIDTH, 155 * HEIGHT, 40 * WIDTH, 60 * HEIGHT)];
        [_lcButton setBackgroundColor:[UIColor clearColor]];
        [self.contentView addSubview:_lcButton];

        _lxdButton = [[UIButton alloc]initWithFrame:CGRectMake(168 * WIDTH, 155 * HEIGHT, 40 * HEIGHT, 60 * HEIGHT)];
        [_lxdButton setBackgroundColor:[UIColor clearColor]];
        [self.contentView addSubview:_lxdButton];
        
        _ztButton = [[UIButton alloc] initWithFrame:CGRectMake(272 * WIDTH, 155 * HEIGHT, 40 * WIDTH, 60 * HEIGHT)];
        [_ztButton setBackgroundColor:[UIColor clearColor]];
        [self.contentView addSubview:_ztButton];
        
    }
    return self;
}

- (void)getJnModel:(GFJnModel *)model{
    [_image sd_setImageWithURL:[NSURL URLWithString:model.image_url] placeholderImage:[UIImage imageNamed:@"zw.png"]];
    [_name_zh_cnLable setText:model.name_zh_cn];
    [_name_enLable setText:model.name_en];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
